.viking-input-wrapper {
  display: flex;
  width: 100%;
  margin-bottom: 30px;
  position: relative;

  .viking-input-icon-wrapper {
    display: flex;
    flex: 1;
    position: relative;
  }

  .icon-wrapper {
    position: absolute;
    right: 0;
    top: 0;
    display: flex;
    justify-content: center;
    align-content: center;
    height: 100%;
    width: 36px;
    color: $input-color;

    svg {
      color: $input-placeholder-color;
    }

    // 去掉原有的svg高度
    .svg-inline--fa {
      height: auto;
    }
  }
}

// 防住icon挡住输入文字
.icon-wrapper + .viking-input-inner {
  padding-right: 36px;
}

// input 样式
.viking-input-inner {
  width: 100%;
  padding: $input-padding-y $input-padding-x;
  font-family: $input-font-family;
  font-size: $input-font-size;
  font-weight: $input-font-weight;
  line-height: $input-line-height;
  color: $input-color;
  background-color: $input-bg;
  background-clip: padding-box;
  border: $input-border-width solid $input-border-color;

  // Note: This has no effect on <select>s in some browsers, due to the limited stylability of `<select>`s in CSS.
  border-radius: $input-border-radius;

  box-shadow: $input-box-shadow;
  transition: $input-transition;

  &:focus {
    color: $input-focus-color;
    background-color: $input-focus-bg;
    border-color: $input-focus-border-color;
    outline: 0;
    box-shadow: $input-focus-box-shadow;
    // Avoid using mixin so we can pass custom focus shadow properly
  }

  &::placeholder {
    color: $input-placeholder-color;
    // Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526.
    opacity: 1;
  }

  &:disabled,
  &[readonly] {
    background-color: $input-disabled-bg;
    border-color: $input-disabled-border-color;
    // iOS fix for unreadable disabled content; see https://github.com/twbs/bootstrap/issues/11655.
    opacity: 1;
  }
}

// input-size 样式
.input-size-sm .viking-input-inner {
  padding: $input-padding-y-sm $input-padding-x-sm;
  font-size: $input-font-size-sm;
  border-radius: $input-border-radius-sm;
}

.input-size-lg .viking-input-inner {
  padding: $input-padding-y-lg $input-padding-x-lg;
  font-size: $input-font-size-lg;
  border-radius: $input-border-radius-lg;
}


// 添加前缀和后缀样式
.input-group {
  .viking-input-group-prepend,
  .viking-input-group-append {
    display: flex;
    align-items: center;
    padding: $input-padding-y $input-padding-x;
    margin-bottom: 0; // Allow use of <label> elements by overriding our default margin-bottom
    font-size: $input-font-size; // Match inputs
    font-weight: $font-weight-normal;
    line-height: $input-line-height;
    color: $input-group-addon-color;
    text-align: center;
    white-space: nowrap;
    background-color: $input-group-addon-bg;
    border: $input-border-width solid $input-group-addon-border-color;
    border-radius: $input-border-radius;
  }

  // prepend样式边角处理
  &.input-group-prepend > .viking-input-group-prepend {
    @include border-right-radius(0)
  }

  &.input-group-prepend .viking-input-inner {
    @include border-left-radius(0)
  }

  // append样式边角处理
  &.input-group-append > .viking-input-group-append {
    @include border-left-radius(0)
  }

  &.input-group-append  .viking-input-inner {
    @include border-right-radius(0)
  }

}


.viking-input-group-append + .btn {
  padding: 0;
  border: 0;
}

